// Some helpful code to help with Part D. Note the code here is incomplete JSONArray cats; color[] colors = {#ccff99, #ffcc66, #ff0000, #9999ff, #cc9900, #006699, #4dffd2}; void setup() { size(600, 400); background(255); //missing code here. See Part D, Step 17 - 20 } void draw() { stroke(153); //code for text size (NOT PROVIDED) text("LEGEND", 440, 120); text("Cat", 430, 150); text("Age", 515, 150); //create two lines to represent X and Y axis (NOT PROVIDED) //create two lines to represent hashmarks (NOT PROVIDED) //create text for Age (NOT PROVIDED) text("YOUR TITLE", 250, 40); for (int i = 0; i < cats.size(); i++) { JSONObject cat = cats.getJSONObject(i); fill(colors[i]); //See step 15 for code to get int age //See step 15 for code to get String name rect(i*30 + 80, 310, 30, -age*20); rect(385, i*25+160, 25, 25); //used to create legend boxes fill(60); //note placement of fill. You could put it outside the for loop but this will present differently text(name, 430, i*25 + 175); text(age, 515, i*25 + 175); } }